<?php
class LastestNewsWidget extends CWidget
{
	public $catId = 0;
	public $data = null;
	public $title = 'Hoạt Động';
	public $readmore = true;
	public $view = 'default';
	public function init()
	{
		if($this->data==null)
			$this->data = FrontendNewsModel::getArticleByCat($this->catId, 5, 0, '', 'ORDER BY tc.views DESC');
		parent::init();
	}
	public function run()
	{
		$this->render("{$this->view}", array(
					'data'=>$this->data,
					'title'=>$this->title,
					'readmore'=>$this->readmore
				));
		parent::run();
	}
}